const path = require('path');
const webpack = require('webpack');

module.exports = {
    entry: path.join(__dirname, 'index.js'),
    output: {
        filename: 'bundle.js',
        path: path.join(__dirname, 'dist')
    },
    // 配置webpack开发服务器
    devServer: {
        contentBase: path.join(__dirname,'dist'),// 服务基础目录
        hot: true
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin()// 热更新插件
    ],
    mode: 'development'
};